/* GUI CONVERTED from rspomtb2.p (converter v1.76) Thu May 23 14:10:18 2002 */
/* rspomtb2.p - Supplier Scheduled Order Sub Program                          */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.17 $                                                          */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 9.0    CREATED: 10/28/98           BY: *K1QZ* Suresh Nayak       */
/* REVISION: 9.0   MODIFIED: 03/13/99           BY: *M0BD* Alfred Tan         */
/* REVISION: 9.1   MODIFIED: 08/12/00           BY: *N0KP* myb                */
/* $Revision: 1.17 $    BY: Jean Miller          DATE: 05/22/02  ECO: *P074*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

/* -----  W A R N I N G  -----  W A R N I N G  -----  W A R N I N G  -----  */
/*                                                                          */
/*         THIS PROGRAM IS A BOLT-ON TO STANDARD PRODUCT MFG/PRO.           */
/* ANY CHANGES TO THIS PROGRAM MUST BE PLACED ON A SEPARATE ECO THAN        */
/* STANDARD PRODUCT CHANGES.  FAILURE TO DO THIS CAUSES THE BOLT-ON CODE TO */
/* BE COMBINED WITH STANDARD PRODUCT AND RESULTS IN PATCH DELIVERY FAILURES.*/
/*                                                                          */
/* -----  W A R N I N G  -----  W A R N I N G  -----  W A R N I N G  -----  */

{mfdeclre.i}

define input parameter pod_recid as recid no-undo.
define input parameter l_new_pod as logical no-undo.

for first pod_det where recid(pod_det) = pod_recid
exclusive-lock: end.

for first po_mstr where po_nbr = pod_nbr
no-lock: end.

for first vd_mstr where vd_addr = po_vend
no-lock: end.

do:
   if pod__qad07 = ? then pod__qad07 = "" .
   if pod__qad05 = ? then pod__qad05 = yes .

   if l_new_pod then do:

      for first qad_wkfl where qad_key1 = "vd_mstr_ash" and
                               qad_key2 = vd_addr
      no-lock: end.

      if available qad_wkfl then do:
         assign
            pod__qad05      = if substring(qad_charfld[1],1,3) = "yes"
                              then yes else no
            pod_firm_days   = integer(qad_decfld[1])
            pod_plan_days   = integer(qad_decfld[2])
            pod_plan_weeks  = integer(qad_decfld[3])
            pod_plan_mths   = integer(qad_decfld[4])
            pod_fab_days    = integer(qad_decfld[5])
            pod_raw_days    = integer(qad_decfld[6])
            pod__qad07      = substring(qad_charfld[2],1,3).
      end.

      else do:
         find first rsc_ctrl no-lock.
         assign
            pod__qad05      = rsc_gen_ship
            pod__qad07      = ""
            pod_firm_days   = rsc_firm_days
            pod_plan_days   = rsc_ship_days
            pod_plan_weeks  = rsc_ship_weeks
            pod_plan_mths   = rsc_ship_months
            pod_raw_days    = rsc_raw_days
            pod_fab_days    = rsc_fab_days.
      end.

   end. /* END OF IF l_new_pod */

end. /* END OF DO */
